PROJECT = ir
DEVICE = pic16f84a
BURNER = /dev/ttyS0
OUTPUT = $(PROJECT).hex

all:	$(PROJECT).asm
	gpasm $<

clean:
	rm -f *.o *.lst *.map *.hex *.cod *.cof disasm.txt

disasm:
	gpdasm -p $(DEVICE) $(OUTPUT) > disasm.txt

burn :
	picprog --nordtsc --device=$(DEVICE) --pic-serial-port=$(BURNER) --burn --input-hexfile=$(OUTPUT)

erase :
	picprog --device=$(DEVICE) --pic-serial-port=$(BURNER) --erase --burn

cook:	erase burn

sim :
	gpsim -p p16f84 $(OUTPUT)

read :
	picprog --nordtsc --device=$(DEVICE) --pic-serial-port=$(BURNER) --output-hexfile=$(OUTPUT).read
